#ifndef INTERFACEEDITOR_H
#define INTERFACEEDITOR_H

#include <QWidget>
#include "interfacepainter.h"
#include "texturemanager.h"

namespace Ui {
class InterfaceEditor;
}

class InterfaceEditor : public QWidget
{
    Q_OBJECT
    
public:
    explicit InterfaceEditor(QWidget *parent = 0);
    ~InterfaceEditor();

    void SetProjectPath(const QString& path) { _path = path; }

    void WidgetClicked(Shiny::Widgets::Container*, sf::Event);
    void CreateWidgetFromEditor(void);

public slots:
    Shiny::Widgets::Container* GetCurrentWidget(void);
    void AddWidget(void);
    void DelWidget(void);
    void LoadUi(void);
    void SelectWidget(int);
    void SelectWidgetChildren(void);
    void SelectWidgetParent(void);
    
private:
    Ui::InterfaceEditor       *ui;
    DataTree*                  _currentUi;
    Data                       _currentWidgetData;
    Shiny::Widgets::Container* _currentWidget;
    QString                    _path;
    TextureManager             _textureManager;

    QList<QPair<QString, Shiny::Widgets::Container*> > _currentList;
};

#endif // INTERFACEEDITOR_H
